#pragma once
#include "EventHandlerBase.h"

namespace Core{
	template<class Reg, typename param1>
	class EventHandler : public EventHandlerBase<param1>{
	public:
		typedef void (Reg::*MemberFunc1)(param1);
		typedef void (Reg::*MemberFunc2)();
		EventHandler(Reg* instance, MemberFunc1 memFn):
			m_instance(instance),m_function1(memFn){}
		EventHandler(Reg* instance, MemberFunc2 memFn):
			m_instance(instance),m_function2(memFn){}

		void call(param1 param){
			(m_instance->*m_function1)(param);
		}

		void call(){
			(m_instance->*m_function2)();
		}

	private:
		Reg* m_instance;
		MemberFunc1 m_function1;
		MemberFunc2 m_function2;
	};
}